from none_bot_py_plugins.gen_svr.create_gen import *


class RequestSvr(GenSvrBase):
    def __init__(self, svr_id):
        super(RequestSvr, self).__init__(svr_id)

    def handle_cast(self, from_id, msg, state):
        return "ok", state

    def handle_info(self, msg, state):
        return "ok", state

    def handle_call(self, from_id, msg, state):
        return "ok", "ok, received!", state

    def handle_stop(self, result, state):
        pass

    def handle_error(self, msg, state):
        return "ok", state

    def _init_(self, *args):
        print("request gen start")
        return []


def request_svr_start():
    request_svr = RequestSvr("request_svr")
    request_svr.task_start([])
    return request_svr

